/**
 * Create by mzq
 * Description: index
 * Date: 2024/9/12 15:29
 * Update: 2024/9/12 15:29
 */

/**
 * 获取当前时间
 * @returns {string}
 */
export function getCurrentDateTime() {
  const date = new Date()

  const year = date.getFullYear()
  const month = ('0' + (date.getMonth() + 1)).slice(-2) // 月份是从0开始的，所以要加1，并且补零
  const day = ('0' + date.getDate()).slice(-2)
  const hour = ('0' + date.getHours()).slice(-2)
  const minute = ('0' + date.getMinutes()).slice(-2)
  const second = ('0' + date.getSeconds()).slice(-2)

  return year + '-' + month + '-' + day + ' ' + hour + ':' + minute
}